﻿Public Class Form227
    Dim strPath As String, strSql As String
    Dim cnn As New OleDb.OleDbConnection
    Dim rs As OleDb.OleDbDataReader, report As ReportExcel.clsReport
    Dim cmd As New OleDb.OleDbCommand
    Private Sub Form227_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'PCV_CLINICDataSet.DoSinhHieu' table. You can move, or remove it, as needed.
        Me.DoSinhHieuTableAdapter.Fill(Me.PCV_CLINICDataSet.DoSinhHieu)
        Me.DoSinhHieuTienSuBenhTableAdapter.Fill(Me.PCV_CLINICDataSet.DoSinhHieuTienSuBenh)
        'setPhanQuyen(True, False, False)
        'Me.RibbonControl.Refresh()
        '=================
        'TODO: This line of code loads data into the 'DataSet11.test' table. You can move, or remove it, as needed.
        strPath = System.AppDomain.CurrentDomain.BaseDirectory()
        Me.OleDbConnection1.Open()
        rs = OleDbCommand1.ExecuteReader

        'tao bao cao
        report = New ReportExcel.clsReport(rs, strPath & "reports\template\rpt_ListOfProducts.xls", strPath & "reports\rpt_ListOfProducts" & Today.Day & Today.Month & Today.Year & Today.Hour & Today.Minute & Today.Second & ".xls")

        report.SetParameter1("$ReportTitle", "List Of Products")
        report.SetParameter1("$ReportDate", "06/11/2006")
        report.SetParameter1("$myparam", "keke")
        report.fillDataToExcel()
        'dong ket noi
        rs.Close()
        rs = Nothing
        cnn.Close()
        cnn = Nothing

        report.OpenReport()
        report = Nothing

    End Sub

    Public Sub New()
        InitializeComponent()
        'Me.IGridView2.setBatLoi("mach", ">2")
        'Me.IGridView2.setMacDinh("mach", 12)
        Me.setObj(Me.PCV_CLINICDataSet, Me.PCV_CLINICDataSet.DoSinhHieu, DoSinhHieuBindingSource, TableAdapterManager, DoSinhHieuTableAdapter, Me.ITextEdit1)
    End Sub
End Class
